It used to be that code to be executed on a personal computer or a workstation was usually supplied by physically inserting a diskette, optical disk or other storage medium into a local drive associated with the personal computer or workstation. Now, such code can simply be downloaded over a computer network. One of the more significant developments in network-based software downloading over the last few years has been the development of Java applets and the Java virtual machine—which allow programs to be dynamically downloaded for execution on an as-needed basis.
Briefly, an applet is a small executable code module that normally doesn't have the complete features and user interface of a normal application. The applet runs inside of an application (for example, a standard web browser) within a “virtual machine”—that is, a set of computer resources and instructions that make up a generally standardized environment for applet's execution. Java is the language most commonly associated with applets, and standard web browsers and other applications include Java-based virtual machines to run Java applets.
Such applets provide a convenient mechanism for flexibly providing client-side functionality. They can provide all sorts of functionality on the client side—everything from graphics support to game play to database lookups to security functions and more. Since Java is a general purpose language, virtually any functionality can be expressed in an applet—but, as discussed below, there are some practical limitations.
In general, how much functionality an applet can provide depends on the applet's size. Small applets download quickly and provide adequate response times, but are limited in terms of their functionality. Larger applets can provide broader functionality but take proportionally longer to download, load and start up. At some point, download/load/startup delay becomes a major hindrance to the use of large applets. No one wants to use an application that takes fifteen minutes to load.
Caching has been used for many years to reduce the time required to load code or data. The idea of caching applets on the client computer is not new. Startup time can be drastically reduced by caching the applet on the client machine. The overall time savings is inversely proportional to the web server connection. Assuming the connection between the client and server is the gating factor, the less information transferred from the server to the client, the better. If the applet can be cached locally the first time it is requested, the user only pays the download penalty once. Subsequent startups should be noticeably faster. Furthermore, there are other reasons besides speed performance for persistently caching applets—for example, reducing network traffic associated with repeatedly downloading the same applet on numerous occasions to the same client machine, and the possibility of flexibly generating vendor-independent persistent class libraries
Unfortunately, caching an applet in today's web browser environments can be a daunting task. This is at least in part because each of the various web browsers and Java virtual machines protect against rogue applets by imposing security constraints and requirements on applet persistence. Currently, the primary commercially available browsers (e.g., Netscape Communicator and Navigator, and Microsoft's Internet Explorer) and applet execution platforms each implement applet caching in different, proprietary ways. Some do not implement applet caching at all. To minimize the risk that a rogue applet will damage a client computer, web browsers generally deny downloaded applets the ability to persist after the web browser has been shut down. Such security precautions if enforced will prohibit persistent applet caching altogether.
Despite a security philosophy that discourages downloaded applets from persisting, certain available applications provide a limited ability to allow applets to persist. As one example, Marimba Inc.'s CASTANET™ software distribution infrastructure provides a Java application that provides deployment and local caching of both applets and applications. See for example U.S. Pat. No. 5,919,247 to Van Hoff. However, the Van Hoff technique requires a separate application to be loaded to handle applet channels, and the technique is based on a file updating concept requiring a particular series of identifiers and/or indices. The Van Hoff technique is not generally applicable across a wide range of different applet execution platforms, and also suffers from other disadvantages.
In contrast to such a separate-application approach, it would be highly desirable to develop applet caching capabilities that would work across a number of client-side platforms such as standard-web browsers available from Netscape, Microsoft, and others. However, Netscape's Communicator browser, Microsoft's Internet Explorer browser in Windows and Macintosh, and JavaSoft's web browser Plug-In have differing security models and signing mechanisms and differing caching abilities. As a result, deploying applet caching to a given platform requires specific code for that platform (e.g., specific packaging and signing on both Communicator and IE), and is not even available on some platforms (Plug-In, IE w/MRJ on Mac, HotJava, etc.). Even the html is specific to some platforms. For at least these reasons, flexible, persistent platform-independent applet caching has not been realized in the past.
This technology herein solves this problem by distributing a caching mechanism implemented by an applet—providing a mechanism and framework for caching applets in a modular and cross-platform manner. In accordance with one exemplary illustrative non-limiting implementation, art applet incorporates a lightweight caching mechanism into its root set of classes. The remainder of the applet is divided into functional modules that can be subsequently downloaded as needed. The initial applet and caching mechanism are packaged and signed in a package using tools and procedures native to each platform. Each functional module of the applet can be packaged and signed in a generic, platform-independent fashion for verification and loading by any of the various platform-dependent initial applet, packages. In this way, the same functional module portions of the applet (which may comprise the bulk of the applet) are cached and loaded in a platform-independent manner without requiring or relying on any caching mechanism built into the platform.
Since the initial applet package does not seed to contain more than only a small number of classes (e.g., a caching mechanism and a class loader), the initial download is short, and startup time is reduced.
In accordance with another exemplary illustrative non-limiting implementation, a cache manager including a class loader is constructed and initialized during applet initialization. The initial applet package makes successive calls to the cache manager, asking it to load further, platform-independent functional modules. For each load request, the cache manager checks to see if the request has already been satisfied, and if not, loads the set of classes into memory via the cache manager's classloader. If the module has not already been loaded, the local cache is checked first. If the module is found in the cache, a version check is made against the requested version. If the cached version is found to be compatible, the module is loaded from the cache. Otherwise, the module is retrieved from the server, cached, and loaded.
The following is a non-exhaustive listing of further features and advantages provided by an exemplary illustrative non-limiting implementation:                An applet persistent mechanism that is consistent across many supported platforms.        Ability to download applets in a piecemeal fashion, with control over the granularity of package size so as minimize initial download size.        A mechanism to allow and support incremental changes to applet modules.        Applet-based deployment and caching—Caching and loading classes and modules on demand based on construction of a class loader within an applet environment in a platform independent manner.        Cross-platform caching—Providing a platform independent caching mechanism reduces a significant amount of work that the applet developer has to do to deploy to multiple platforms. Because caching is implemented by an applet, it is not necessary to know about or use any particular caching mechanisms on the client's application (which can vary from one platform to another).        Modular caching—Breaking an applet up into functional groups, and then fetching them on an as-needed basis, allows the applet to start up quicker by eliminating the download of unseeded classes or other parts of the applet (e.g., fonts, images, sounds, etc.). The applet itself directs what additional modules are needed and when. Additionally, functional groups can be shared by any number of applets. One applet can benefit from another applet having already downloaded a needed group of functional modules.        Optimized compression and storage of applet modules—Module contents are packaged in an optimal manner for downloading that maximizes the compression algorithms available. By packaging all classes and other components into one stream and compressing only the stream, compression overhead is reduced. As a result, compressed modules are considerably smaller than a compressed standard archive file with the same classes. In contrast with the standard archive (which digitally signs each individual file and stores the resulting digests as a “manifest” file in the archive), we sign the entire stream once—eliminating the need for the manifest file. This reduces overall size and increases “unpacking” efficiency by reducing sign verification overhead.        A lightweight, wrapping applet that implements the caching mechanism can be used to launch other applets without their needing to implement cache manager. The wrapped applet can be packaged, signed, and used for deploying and caching an applet on a number of platforms without need for packaging or signing anything for each specific platform.        Applications can be broken up into functional modules that may be versioned and distributed separately.        Communication between the main applet classes and the functional modules is rooted through a communication service that is downloaded with the main applet.        